package com.qkst.website.web.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.qkst.website.backstage.bean.ProductBean;
import com.qkst.website.backstage.mapper.ProductMapper;
import com.qkst.website.web.service.ProductService;

/**
 * @author lihao
 * @description 产品service
 * @date 2017-05-11
 * @email ahlxlihao@163.com
 *
 */
@Service("webProductService")
@Transactional
public class ProductServiceImpl implements ProductService {
	
	@Autowired
	private ProductMapper productMapper;
	
	/**
	 * 根据产品条件查询产品
	 * @param product
	 * @return List<ProductBean>
	 */
	public List<ProductBean> queryProductList(ProductBean product){
		//分页计算
		return productMapper.selectProductList(product);
	}
	
	/**
	 * 查询产品总记录数
	 * @param order
	 * @return 
	 */
	@Override
	public int queryCount(ProductBean product) {
		return productMapper.selectCount(product);
	}

	/**
	 * 根据产品编号获取产品信息
	 * @param order
	 * @return 
	 */
	@Override
	public ProductBean queryProductByPartnum(String partnum) {
		return productMapper.selectProductByPartnum(partnum);
	}

}
